home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / tiff / tiffsubs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-11-02  |  802 b   |  53 lines

  1. /* tiffsubs.c
  2.  *
  3.  */
  4.  
  5. #include "aldtypes.h"
  6. #include "imtypes.h"
  7. #include "imag.h"
  8. #include "imtiff.h"
  9. #include "tiff.h"
  10. #include "ImErr.h"
  11.  
  12. #if 0
  13. #define IMPDEFS
  14. #include "errdefs.h"
  15. #endif /* 0 */
  16.  
  17. /* get the sizeof a TIFF data type
  18.  */
  19. RC GtTiffSizeof (n, p)
  20. WORD n;        /* TIFFBYTE or ... */
  21. WORD *p;    /* output */
  22. {
  23.     RC err = SUCCESS;
  24.  
  25.     switch (n) {
  26.     case TIFFBYTE:
  27.     case TIFFASCII:
  28.         *p = 1;
  29.         break;
  30.     case TIFFSHORT:
  31.         *p = 2;
  32.         break;
  33.     case TIFFLONG:
  34.         *p = 4;
  35.         break;
  36.     case TIFFRATIONAL:
  37.         *p = 8;
  38.         break;
  39.     case TIFFSIGNED:
  40.         *p = 2;
  41.         break;
  42.     case TIFFFLOAT:        /* manufactured type -- not found in TIFF file */
  43.         *p = sizeof(float);
  44.         break;
  45.     default:
  46.         DBMSG(("GtTiffSizeof: n=%d\n", n));
  47.         *p = 1;
  48.         err = IM_BUG;
  49.         break;
  50.     }
  51.     return err;
  52. }
  53.